// Copyright  2004-2008 Backplane Ltd.
//
// This file is part of Ubiquity formsPlayer
//
// Ubiquity formsPlayer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
//
// Ubiquity formsPlayer is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License
// along with Ubiquity formsPlayer If not, see <http://www.gnu.org/licenses/>.
//	
//
//   Purpose: declaration of IBindingTarget.
//   $Id$
#ifndef __BindingTarget_H
#define __BindingTarget_H
//Pure virtual interface for use in CBoundNode::AddTarget
//and CBoundNode::RemoveTarget.
class CBoundNode;
class IBindingTarget
{
	public:
		virtual HRESULT onvalid() = 0;
		virtual HRESULT oninvalid() = 0;
		
		virtual HRESULT onreadwrite() = 0;
		virtual HRESULT onreadonly() = 0;

		virtual HRESULT onrequired() = 0;
		virtual HRESULT onoptional() = 0;

		virtual HRESULT ondisabled() = 0;
		virtual HRESULT onenabled() = 0;

		virtual HRESULT onvaluechanged() = 0;
		virtual void disconnect(CBoundNode * pNode) = 0;

		/// <summary>Inform the element to set its inital state which intern will set the 
		/// appropriate css classes on the element.</summary>
		virtual HRESULT setInitalState(bool bEnabled, bool bReadOnly, bool bValid, bool bRequired) = 0;
		/// <summary>Informs the element whether it is currently being bound to a node. This is set to true
		/// at the being of the CBoundNode::addTarget() and false at the end. This should then be used to
		/// stop us processing the default events for valid, required etc to save on processing.</summary>
		virtual void bindingToNode(bool bBinding) = 0;
	protected:
		IBindingTarget(){};
		virtual ~IBindingTarget(){};
};

#endif